/*
 * Copyright (C) 2008 The Android Open Source Project
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/**@defgroup utsname Utsname
 * @ingroup libc
 */

#ifndef _SYS_UTSNAME_H_
#define _SYS_UTSNAME_H_

#include <sys/cdefs.h>

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */

/**
 * @ingroup utsname
 * Maximum length for members of the structure utsname.
 */
#define SYS_NMLN 65

/**
 * @ingroup utsname
 * The defination of structure utsname.
 */
struct utsname {
    char  sysname   [SYS_NMLN]; /* Name of this implementation of the operating system. */
    char  nodename  [SYS_NMLN]; /* Name of this node within the communications
                                   network to which this node is attached, if any. */
    char  release   [SYS_NMLN]; /* Current release level of this implementation. */
    char  version   [SYS_NMLN]; /* Current version level of this release.  */
    char  machine   [SYS_NMLN]; /* Name of the hardware type on which the system is running. */
    char  domainname[SYS_NMLN]; /* Name of domain */
};

/**
 *@ingroup utsname
 *
 *@par Description:
 *This API is used to get the name of current system.
 *@attention
 *<ul>
 *<li> The members "machine" and "domainname" is not supported.</li>
 *</ul>
 *
 *@retval  0    Get the name of current system successfully.
 *@retval  -1   Fails to get the name of current system.
 *
 *@par Dependency:
 *<ul><li>utsname.h</li></ul>
 *@since Huawei LiteOS V100R001C00
 */
extern int uname(struct utsname *);


#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */

#endif /* _SYS_UTSNAME_H_ */
